package cool.webstudy.admin.constant.enums.rescode;

import lombok.extern.slf4j.Slf4j;

/**安华
 * 队伍管理响应信息
 */
@Slf4j
public enum TeamResCodeEnum implements BaseResCodeEnum{
    RC_ERROR_CREATE("50001","创建队伍失败"),
    RC_ERROR_DELETE("50002","删除队伍失败"),
    RC_ERROR_UPDATE("50003","更新队伍失败"),
    RC_TEAM_NOT_EXIST("50004","队伍不存在！"),
    RC_ERROR_QUERY("50005","查询队伍失败")
    ;
    String code;
    String msg;
    TeamResCodeEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    @Override
    public String code() {
        return code;
    }

    @Override
    public String msg() {
        return msg;
    }

    public static TeamResCodeEnum getMsgByCode(String code){
        for (TeamResCodeEnum teamResCodeEnum : TeamResCodeEnum.values()) {
            if (teamResCodeEnum.code().equals(code)){
                return teamResCodeEnum;
            }
        }
        log.error("getMsgByCode 无法获取枚举值");
        return null;
    }
}
